//package com.example.springboot.RabbitMQ.BasicOperation;
//
//import com.rabbitmq.client.BuiltinExchangeType;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
////扇形交换机采用广播模式，将接收到的消息分发给所有绑定到该交换机的队列。
////应用场景：适用于需要广播消息的场景，例如实时消息发布。
////特点：消息会被转发到与该交换机绑定的所有队列上，类似于子网广播。
//
//@Component
//public class FanoutDome {
//
//    @Autowired
//    private static BasicOperation basicOperation;
//
//    private static String exchangeName = "exchange_Fanout_01";
//    private static String queueName_01 = "queue_Fanout_01";
//    private static String queueName_02 = "queue_Fanout_02";
//    private static String routingKey_01 = "routingKey_Fanout_01";
//    private static String routingKey_02 = "routingKey_Fanout_02";
//    private static BuiltinExchangeType builtinExchangeType = BuiltinExchangeType.FANOUT;
//
//    public void builder() throws IOException {
//
//        basicOperation.createExchange(exchangeName,builtinExchangeType,true,false,null);
//
//        basicOperation.createQueue(queueName_01,true,false,false,null);
//        basicOperation.createQueue(queueName_02,true,false,false,null);
//
//        basicOperation.queueBind(queueName_01,exchangeName,routingKey_01);
//        basicOperation.queueBind(queueName_02,exchangeName,routingKey_02);
//
//    }
//
//
//    public void sendMsg() throws IOException {
//
//        String message_01 = "Hello queues";
//
//        basicOperation.sendMsg(exchangeName,"123",null,message_01);
//
//    }
//
//    public void receiveMsg() throws IOException {
//
//        basicOperation.receiveMsg(queueName_01);
//        basicOperation.receiveMsg(queueName_02);
//
//    }
//
//
//
//}
